<?php
use \think\Route;
Route::get('/','index/Index/index');
Route::miss(function(){
    echo json_encode(['code' => -2,'msg' => '请求错误,请检查路由!','data' => []]);exit;    
});
//后台路由
Route::group('admin',function(){
    Route::post('login','admin/LoginController/login');             //登录
    Route::group('user',function(){
        Route::post('index','admin/UserController/index');          //用户列表
        Route::post('edit','admin/UserController/edit');            //编辑用户
    });
    Route::group('cat',function(){
        Route::post('create','admin/CatController/create');         //新建分类
        Route::post('delete','admin/CatController/delete');         //删除分类
        Route::post('edit','admin/CatController/edit');             //编辑分类
        Route::post('index','admin/CatController/index');           //分类列表
    });
    Route::group('content',function(){
        Route::post('edit','admin/ContentController/edit');         //编辑内容
        Route::post('info','admin/ContentController/info');         //内容详情    
    });
    Route::group('tool',function(){
        Route::post('create','admin/ToolController/create');        //新增工具
        Route::post('delete','admin/ToolController/delete');        //删除工具
        Route::post('edit','admin/ToolController/edit');            //编辑工具
        Route::post('index','admin/ToolController/index');          //工具列表
    });
    Route::group('logs',function(){
        Route::post('index','admin/LogsController/index');          //日志列表    
    });
    Route::group('board',function(){
        Route::post('info','admin/BoardController/info');           //面板数据    
    });
});
//前台路由
Route::get('test1','api/LoginController/test1');                    //测试路由
Route::group('api',function(){
    Route::group('user',function(){
        Route::post('login','api/LoginController/login');           //登录
        Route::post('test','api/LoginController/test');
    });
    Route::group('speech',function(){
        Route::post('create','api/VoiceController/create');         //合成语音    
           
    });
    Route::group('chat',function(){
        Route::post('create','api/ChatController/create');          //开始会话
        Route::post('edit','api/ChatController/edit');              //编辑会话标题   
        Route::post('delete','api/ChatController/delete');          //删除会话
        Route::post('index','api/ChatController/index');            //会话列表 
        Route::post('info','api/ChatController/info');              //会话详情 
    });
    Route::group('picture',function(){
        Route::post('index','api/PictureController/index');         //图库列表     
        Route::post('degree','api/PictureController/degree');       //剩余次数     
        Route::post('poll','api/PictureController/poll');           //轮询结果     
        Route::post('delete','api/PictureController/delete');       //删除会话     
    });
    Route::group('article',function(){
        Route::post('index','api/ArticleController/index');         //文章列表
        Route::post('edit','api/ArticleController/edit');           //编辑文章
        Route::post('delete','api/ArticleController/delete');       //删除文章
    });
    Route::group('ppt',function(){
        Route::post('token','api/DocmeeController/token');          //获取token    
    });
    Route::group('index',function(){
        Route::post('index','api/IndexController/index');           //首页列表
    });
});
